<?php
echo $this->adminToolBar('camping', 'index', '/admin/campaign/add/id/'.$this->id, '/admin/campaign/edit/', '/admin/campaign/delete/','');
?> 
<?php         
$this->title = "camping";
$this->headTitle($this->title);
?>
<div class="mid-content" id="grid_rate">
    <table class="box-table-a" width="100%">
	<tr>
	    <th>Title</th>
	    <th>Desc</th>
            <th>Active</th>
            <th>National Park</th>
	    <th>&nbsp;</th>
              <th>&nbsp;</th>
	    <th>&nbsp;</th>
            <th>&nbsp;</th>
	</tr>
<?php foreach($this->Campaign_arr as $campaign) : ?>
	<tr>
	    <td><?php echo $campaign['title'];?></td>
	    <td><?php echo $campaign['description'] ;?></td>
	    <td><?php echo $campaign['active'] ;?></td>
            <td><?php echo $campaign['park'] ;?></td>
	    <td><a href="javascript: void(0);" onclick="loadPage('/admin/campaign/edit/id/<?php echo $campaign['id'] ?>');" title="Edit"><img src="/images/admin/icons/edit.gif" alt=""/></a></td>
	    <td><a href="javascript: void(0);" onclick="loadPage('/admin/campaign/campaignfeatures/id/<?php echo $campaign['id'] ?>');" title="Edit"><img src="/images/admin/icons/a-plus.gif" alt=""/></a></td>
            <td><a rel="" onclick="deletecampaign('<?php echo $campaign['id'];?>','<?php echo $campaign['id'];?>')" href="javascript: void(0);"><img src="/images/admin/icons/disable.gif" alt=""/></a></td>
            <td><a href="javascript: void(0);" onclick="loadPage('/admin/campaign/addrates/id/<?php echo $campaign['id']; ?>');"><img src="/images/admin/icons/money.png" title="View Rates" alt=""/></a></td>
	</tr>
<?php 
	endforeach; 
?>
</table>
</div>
<script type="text/javascript">

function deletecampaign(id)
{
	 if(confirm("Are you sure that you want to delete this excursin?"))
             {$.ajax({
			type: "POST",
			url: '/admin/campaign/deletecampaign/',
			data: ({id:id}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/campaign/');
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	            $("#loader_area").hide();
	        }
		});
             }
}

</script>


